package com.itheima.mylambda.test1;

public class TestSwimming {
    public static void main(String[] args) {
        //调用goswimming方法 后面接受的参数其实实现类的对象  运用我们的匿名内部内
        goSwimming(()->{System.out.println("hi,咱们一起去划水吧");});

    }
    public static void goSwimming(Swimming swimming){
        swimming.swim();//同对象去调用show但是show方法还没有重写

//        Swimming s = new Swimming() {
//            @Override
//            public void swim() {
//                System.out.println("hi,咱们一起去划水吧");
//            }
//        };
        swimming.swim();

    }
}
 //定义接口
interface Swimming {
    void swim();
 }